#ifndef LOGGER_H_20101221
#define LOGGER_H_20101221

#ifdef LOG4CPLUSLOGGER
#include <log4cplus/logger.h>

//#define DECL_LOGGER(logger) static log4cplus::Logger logger;
//#define IMPL_LOGGER(classname, logger) log4cplus::Logger classname::logger = log4cplus::Logger::getInstance(#classname);
//#define LOG4CPLUS_CLASS_IMPLEMENT(classname, logger, name)	log4cplus::Logger classname::logger = log4cplus::Logger::getInstance(name)

//////////////////////////////////////////////////////////////////////////

#define LOG_CLASS_DECLARE()						static log4cplus::Logger	logger_
#define LOG_CLASS_IMPLEMENT( class )			log4cplus::Logger class::logger_ = log4cplus::Logger::getInstance( #class )
#define LOG_CLASS_IMPLEMENT_EX( class, name )	log4cplus::Logger class::logger_ = log4cplus::Logger::getInstance( name )

#define LOG_TRACE( x )		LOG4CPLUS_TRACE( logger_, x )
#define LOG_DEBUG( x )		LOG4CPLUS_DEBUG( logger_, x )
#define LOG_INFO( x )		LOG4CPLUS_INFO( logger_, x )
#define LOG_WARN( x )		LOG4CPLUS_WARN( logger_, x )
#define LOG_ERROR( x )		LOG4CPLUS_ERROR( logger_, x )
#define LOG_FATAL( x )		LOG4CPLUS_FATAL( logger_, x )


#else  // LOG4CPLUSLOGGER

#define _LOG4CPLUS_LOGGING_MACROS_HEADER_

#define LOG_TRACE( x )
#define LOG_DEBUG( x )
#define LOG_INFO( x )
#define LOG_WARN( x )
#define LOG_ERROR( x )
#define LOG_FATAL( x )

#define DECL_LOGGER(logger)
#define IMPL_LOGGER(classname, logger)
#define LOG_CLASS_DECLARE()
#define LOG_CLASS_IMPLEMENT( class )
#define LOG_CLASS_IMPLEMENT_EX( class, name )

#endif // LOG4CPLUSLOGGER

#endif //LOGGER_H_20101221